import request from '@/utils/request'

const fetchYear = () => {
  return request.get('/api/v1/exhibition/year')
}

const queryYear = (params) => {
  return request.get('/api/v1/exhibition/query', {params: params})
}

const createExpo = (params) => {
  return request.post('/api/v1/exhibition/create', params)
}

const editExpo = (uid, params) => {
  return request.put(`/api/v1/exhibition/edit/${uid}`, params)
}

const deleteExpo = (uid) => {
  return request.delete(`/api/v1/exhibition/deleted/${uid}`)
}

const fetchDetail = (uid) => {
  return request.get(`/api/v2/expo-module/child/${uid}`)
}

// const getModule = (uid) => {
//   return request.get(`/api/v2/expo-module/child/${uid}`)
// }
const fetchDetailFist = (uid) => {
  return request.get('/api/v2/exhibition/details/' + uid)
}

const getCreateImage = () => {
  return request.get('/api/v1/exhibition/get-create-image')
}

export default {
  fetchYear,
  queryYear,
  createExpo,
  editExpo,
  deleteExpo,
  fetchDetail,
  getCreateImage,
  fetchDetailFist
}
